<?php defined('_JEXEC') or die('Restricted access'); ?>

<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="col100">
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'Details' ); ?></legend>

		<table class="admintable">
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_name">
					<?php echo JText::_( 'Name' ); ?>:
				</label>
			</td>
			<td>
				<input class="text" type="text" name="c_name" id="c_name" size="32" maxlength="250" value="<?php echo $this->house->c_name;?>" />
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="p_id">
					<?php echo JText::_( 'Province' ); ?>:
				</label>
			</td>
			<td>
			<select id='p_id' name='p_id' class='p_id' size='1'>
			<option value=""><?php echo JText::_( 'Select a Province' ); ?></option>
			<?php if($this->provinces) : ?>
			<?php foreach($this->provinces as $province): ?>
				<option value="<?php echo $province->p_id ?>" <?php if(isset($this->house->p_id) && $province->p_id == $this->house->p_id) echo " selected='selected' "; ?>><?php echo $province->p_name ?></option>
			<?php endforeach; ?>
			<?php endif; ?>
			</select>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_address">
					<?php echo JText::_( 'Address' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_address" id="c_address" size="32" maxlength="250"><?php echo $this->house->c_address;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_country">
					<?php echo JText::_( 'Country' ); ?>:
				</label>
			</td>
			<td>
<select style="width: 300px;" name="c_country">
						<option value="<?php echo $this->house->c_country ?>"><?php echo $this->house->c_country ?></option>
<option>Afghanistan</option><option>Albania</option><option>Algeria</option><option>American Samoa</option><option>Andorra</option><option>Angola</option><option>Anguilla</option><option>Antarctica</option><option>Antigua and arbuda</option><option>Argentina</option><option>Armenia</option><option>Aruba</option><option>Australia</option><option>Austria</option><option>Azerbaijan</option><option>Bahamas</option><option>Bahrain</option><option>Bangladesh</option><option>Barbados</option><option>Belarus</option><option>Belgium</option><option>Belize</option><option>Benin</option><option>Bermuda</option><option>Bhutan</option><option>Bolivia</option><option>Bosnia and Herzegovina</option><option>Botswana</option><option>Bouvet Island</option><option>Brazil</option><option>British Indian Ocean Territory</option><option>Brunei Darussalam</option><option>Bulgaria</option><option>Burkina Faso</option><option>Burundi</option><option>Cambodia</option><option>Cameroon</option><option>Canada</option><option>Cape Verde</option><option>Cayman Islands</option><option>Central African Republic</option><option>Chad</option><option>Chile</option><option>China</option><option>Christmas Island</option><option>Cocos Keeling Islands</option><option>Colombia</option><option>Comoros</option><option>Congo</option><option>Cook Islands</option><option>Costa Rica</option><option>Ivory Coast</option><option>Croatia</option><option>Cuba</option><option>Cyprus</option><option>Czech Republic</option><option>Denmark</option><option>Djibouti</option><option>Dominican Republic</option><option>Dominica</option><option>East Timor</option><option>Ecuador</option><option>Egypt</option><option>El Salvador</option><option>Equatorial Guinea</option><option>Eritrea</option><option>Estonia</option><option>Ethiopia</option><option>Falkland Islands</option><option>Faroe Islands</option><option>Fiji</option><option>Finland</option><option>France</option><option>French Guiana</option><option>French Polynesia</option><option>French Southern Territories</option><option>Gabon</option><option>Gambia</option><option>Georgia</option><option>Germany</option><option>Ghana</option><option>Gibraltar</option><option>Greece</option><option>Greenland</option><option>Grenada</option><option>Guadeloupe</option><option>Guam</option><option>Guatemala</option><option>Guinea-Bissau</option><option>Guinea</option><option>Guyana</option><option>Haiti</option><option>Heard and McDonald Islands</option><option>Honduras</option><option>Hong Kong</option><option>Hungary</option><option>Iceland</option><option>India</option><option>Indonesia</option><option>Iran</option><option>Iraq</option><option>Ireland</option><option>Israel</option><option>Italy</option><option>Jamaica</option><option>Japan</option><option>Jordan</option><option>Kazakhstan</option><option>Kenya</option><option>Kiribati</option><option>North Korea</option><option>South Korea</option><option>Kuwait</option><option>Kyrgyzstan</option><option>Laos</option><option>Latvia</option><option>Lebanon</option><option>Lesotho</option><option>Liberia</option><option>Libya</option><option>Liechtenstein</option><option>Lithuania</option><option>Luxembourg</option><option>Macau</option><option>Macedonia</option><option>Madagascar</option><option>Malawi</option><option>Malaysia</option><option>Maldives</option><option>Mali</option><option>Malta</option><option>Marshall slands</option><option>Martinique</option><option>Mauritania</option><option>Mauritius</option><option>Mayotte</option><option>Mexico</option><option>Micronesia</option><option>Moldova</option><option>Monaco</option><option>Mongolia</option><option>Montserrat</option><option>Morocco</option><option>Mozambique</option><option>Myanmar</option><option>Namibia</option><option>Nauru</option><option>Nepal</option><option>Netherlands Antilles</option><option>Netherlands</option><option>New Caledonia</option><option>New Zealand</option><option>Nicaragua</option><option>Nigeria</option><option>Niger</option><option>Niue</option><option>Norfolk Island</option><option>Northern Mariana slands</option><option>Norway</option><option>Oman</option><option>Pakistan</option><option>Palau</option><option>Panama</option><option>Papua New Guinea</option><option>Paraguay</option><option>Peru</option><option>Philippines</option><option>Pitcairn</option><option>Poland</option><option>Portugal</option><option>Puerto Rico</option><option>Qatar</option><option>Reunion</option><option>Romania</option><option>Russian Federation</option><option>Rwanda</option><option>S Georgia and S Sandwich Isles</option><option>Saint Kitts and Nevis</option><option>Saint Lucia</option><option>Saint Vincent and The Grenadines</option><option>Samoa</option><option>San Marino</option><option>Sao Tome and Principe</option><option>Saudi Arabia</option><option>Senegal</option><option>Seychelles</option><option>Sierra Leone</option><option>Singapore</option><option>Slovak Republic</option><option>Slovenia</option><option>Solomon Islands</option><option>Somalia</option><option>South Africa</option><option>Spain</option><option>Sri Lanka</option><option>St. Helena</option><option>St. Pierre and Miquelon</option><option>Sudan</option><option>Suriname</option><option>Svalbard and Jan Mayen Islands</option><option>Swaziland</option><option>Sweden</option><option>Switzerland</option><option>Syria</option><option>Taiwan</option><option>Tajikistan</option><option>Tanzania</option><option>Thailand</option><option>Togo</option><option>Tokelau</option><option>Tonga</option><option>Trinidad and Tobago</option><option>Tunisia</option><option>Turkey</option><option>Turkmenistan</option><option>Turks and Caicos Islands</option><option>Tuvalu</option><option>US Minor Outlying Islands</option><option>Uganda</option><option>Ukraine</option><option>United Arab Emirates</option><option>United Kingdom</option><option>United States</option><option>Uruguay</option><option>Uzbekistan</option><option>Vanuatu</option><option>Vatican City State</option><option>Venezuela</option><option>Viet Nam</option><option>British Virgin Islands</option><option>US Virgin Islands</option><option>Wallis and Futuna Islands</option><option>Western Sahara</option><option>Yemen</option><option>Yugoslavia</option><option>Zaire</option><option>Zambia</option><option>Zimbabwe</option></select>
</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_tel">
					<?php echo JText::_( 'Telephones' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_tel" id="c_tel" size="32" maxlength="250"><?php echo $this->house->c_tel;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_fax">
					<?php echo JText::_( 'Faxes' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_fax" id="c_fax" size="32" maxlength="250"><?php echo $this->house->c_fax;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_email">
					<?php echo JText::_( 'Emails' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_email" id="c_email" size="32" maxlength="250"><?php echo $this->house->c_email;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_web">
					<?php echo JText::_( 'Web' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_web" id="c_web" size="32" maxlength="250"><?php echo $this->house->c_web;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_found">
					<?php echo JText::_( 'Foundation' ); ?>:
				</label>
			</td>
			<td>
				<textarea class="text" type="text" name="c_found" id="c_found" size="32" maxlength="250"><?php echo $this->house->c_found;?></textarea>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">
				<label for="c_diocese">
					<?php echo JText::_( 'Diocese' ); ?>:
				</label>
			</td>
			<td>
				<input class="text" type="text" name="c_diocese" id="c_diocese" size="32" maxlength="250" value="<?php echo $this->house->c_diocese;?>" />
			</td>
		</tr>

		<tr>
			<td width="100" align="right" class="key">
				<label for="ordering">
					<?php echo JText::_( 'Ordering' ); ?>:
				</label>
			</td>
			<td>
			<select id='ordering' name='ordering' class='inputbox' size='1'>
			<option value="0">0 <?php echo JText::_( 'First' ); ?></option>
			<?php if($this->houses) : ?>
			<?php foreach($this->houses as $house): ?>
				<option value="<?php echo $house->ordering ?>" <?php if(isset($this->house->ordering) && $house->ordering == $this->house->ordering) echo " selected='selected' "; ?>><?php echo $house->ordering . " " . $house->c_name ?></option>
			<?php endforeach; ?>
			
			<option value='<?php echo (count($this->houses) + 1) ?>'><?php echo (count($this->houses) + 1) . " " . JText::_( 'Last' ); ?></option>
			<?php endif; ?>
			</select>
			</td>
		</tr>
	
 		<tr>
			<td width="100" align="right" class="key" valign="top">
				<label for="c_info">
					<?php echo JText::_( 'More info' ); ?>:
				</label>
			</td>
			<td>
              <?php echo $this->editor->display('c_info',  $this->house->c_info , '650', '500', '75', '20') ; ?>
			
			</td>
		</tr>		
	</table>
	</fieldset>
</div>
<div class="clr"></div>

<input type="hidden" name="option" value="com_congregation" />
<input type="hidden" name="c_id" value="<?php echo $this->house->c_id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="house" />
</form>
